package cate.game.pvp.championrace.data;

import cate.game.rank.po.Rank;
import lombok.Data;
import org.springframework.data.annotation.Id;

@Data
public class ChampionRaceRank extends Rank {
    @Id
    private String uid;
    private int winCount;
    private int loseCount;

    public static ChampionRaceRank of(ChampionRacePs ps) {
        ChampionRaceRank rank = new ChampionRaceRank();
        rank.setUid(ps.getUid());
        rank.value = ps.getOpponent().getPoints();
        rank.owner = ps.getOpponent().getSnapshot();
        rank.setWinCount(ps.getOpponent().getWinCount());
        rank.setLoseCount(ps.getOpponent().getLoseCount());
        rank.recordTime = System.currentTimeMillis();
        return rank;
    }
}
